From 8589a3bc97190c3d3bbb7246ea517e7855abfeed Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 22 Jul 2025 10:03:40 +0300 Subject: cleanup and styling --- src/pages/[...blog]/index.astro | 54 ----------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/pages/[...blog]/index.astro (limited to 'src/pages/[...blog]/index.astro') diff --git a/src/pages/[...blog]/index.astro b/src/pages/[...blog]/index.astro deleted file mode 100644 index 421927c..0000000 --- a/src/pages/[...blog]/index.astro +++ /dev/null @@ -1,54 +0,0 @@ ---- -import type { InferGetStaticPropsType, GetStaticPaths } from 'astro'; - -import merge from 'lodash.merge'; -import type { ImageMetadata } from 'astro'; -import Layout from '~/layouts/PageLayout.astro'; -import SinglePost from '~/components/blog/SinglePost.astro'; -import ToBlogLink from '~/components/blog/ToBlogLink.astro'; - -import { getCanonical, getPermalink } from '~/utils/permalinks'; -import { getStaticPathsBlogPost, blogPostRobots } from '~/utils/blog'; -import { findImage } from '~/utils/images'; -import type { MetaData } from '~/types'; -import RelatedPosts from '~/components/blog/RelatedPosts.astro'; - -export const prerender = true; - -export const getStaticPaths = (async () => { - return await getStaticPathsBlogPost(); -}) satisfies GetStaticPaths; - -type Props = InferGetStaticPropsType; - -const { post } = Astro.props as Props; - -const url = getCanonical(getPermalink(post.permalink, 'post')); -const image = (await findImage(post.image)) as ImageMetadata | string | undefined; - -const metadata = merge( - { - title: post.title, - description: post.excerpt, - robots: { - index: blogPostRobots?.index, - follow: blogPostRobots?.follow, - }, - openGraph: { - type: 'article', - ...(image - ? { images: [{ url: image, width: (image as ImageMetadata)?.width, height: (image as ImageMetadata)?.height }] } - : {}), - }, - }, - { ...(post?.metadata ? { ...post.metadata, canonical: post.metadata?.canonical || url } : {}) } -) as MetaData; ---- - - - - {post.Content ? : } - - - - -- cgit v1.2.3